package chapterSystem.client.model.entities;

import chapterSystem.client.model.entitiesInt.Order;

import java.util.Date;

/**
 * User: Hasp
 * Date: 27.03.12
 * Time: 17:49
 */
public class OrderEntity implements Order {
    private int id;
    private int authorId;
    private int receiverId;
    private String text;
    private Date date;
    private boolean isExecuted;
    private Date executionDate;
    private String executionReport;
    private String authorName;
    private String receiverName;

    public OrderEntity(){
    }

    public OrderEntity(Date date, String text, int receiverId, int authorId, int id, Date executionDate,
                       String executionReport, boolean executed, String authorName, String receiverName) {
        this.date = date;
        this.text = text;
        this.receiverId = receiverId;
        this.authorId = authorId;
        this.id = id;
        this.executionDate = executionDate;
        this.executionReport = executionReport;
        isExecuted = executed;
        this.authorName = authorName;
        this.receiverName = receiverName;
    }

    public int getId() {
        return id;
    }

    public int getAuthorId() {
        return authorId;
    }

    @Override
    public String getAuthorName() {
        return authorName;
    }

    @Override
    public String getReceiverName() {
        return receiverName;
    }

    public int getReceiverId() {
        return receiverId;
    }

    public String getText() {
        return text;
    }

    public Date getDate() {
        return date;
    }

    public boolean isExecuted() {
        return isExecuted;
    }

    public Date getExecutionDate() {
        return executionDate;
    }

    @Override
    public void setText(String text) {
        this.text = text;
    }

    public String getExecutionReport() {
        return executionReport;
    }

    @Override
    public String toString() {
        return "OrderEntity{" +
                "id=" + id +
                ", authorId=" + authorId +
                ", receiverId=" + receiverId +
                ", text='" + text + '\'' +
                ", date=" + date +
                ", isExecuted=" + isExecuted +
                ", executionDate=" + executionDate +
                ", executionReport='" + executionReport + '\'' +
                ", authorName='" + authorName + '\'' +
                ", receiverName='" + receiverName + '\'' +
                '}';
    }
}
